package com.itheima.a03static;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        //1.创建一个集合用来存储学生对象
        ArrayList<Student> list = new ArrayList<>();

        //创建三个学生对象
        Student s1 = new Student("张三", 18,"男");
        Student s2 = new Student("李四", 19,"女");
        Student s3 = new Student("王五", 20,"男");

        //把学生对象添加到集合中
        list.add(s1);
        list.add(s2);
        list.add(s3);

        //调用工具类中的方法
        int maxAgeStudent = StudentUtil.getMaxAge(list);

        System.out.println(maxAgeStudent);
    }
}
